package cn.wolfcode.wolf2w.controller;

import cn.wolfcode.wolf2w.domain.Banner;
import cn.wolfcode.wolf2w.domain.Strategy;
import cn.wolfcode.wolf2w.domain.Travel;
import cn.wolfcode.wolf2w.query.BannerQuery;
import cn.wolfcode.wolf2w.service.IBannerService;
import cn.wolfcode.wolf2w.service.IStrategyService;
import cn.wolfcode.wolf2w.service.ITravelService;
import cn.wolfcode.wolf2w.util.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.List;

/**
* banner推荐控制层
*/
@RestController
@RequestMapping("index")
public class BannerController {

    @Autowired
    private IBannerService bannerService;

    @GetMapping("/banners/travel")
    public Object getTravels() {
         List<Banner> banners = bannerService.queryBanners(Banner.STATE_NORMAL, Banner.TYPE_TRAVEL);

         return JsonResult.success(banners);
    }
    @GetMapping("/banners/strategy")
    public Object getstrategy() {
        Banner banner = bannerService.querystrategy(Banner.STATE_NORMAL, Banner.TYPE_STRATEGY);

        return JsonResult.success(banner);
    }
}

